


***********************************************
****** The Impact of Soft-Skills Training *****
******    for Entrepreneurs in Jamaica    *****
***********************************************


* This file cleans the data coming from the questionnaire for follow-up 2


clear all
cap log close
set more off

cap cd "$directory"



*******************
*** Follow-up 1 ***
*******************

*** Load data ***

* Load data
use "$data_raw/fu2_data", clear

* Use variable name if no variable label available
foreach var of varlist * {
	if "`: var lab `var''"=="" lab var `var' "`var'"
}


*** Edit data ***

replace m2q17_4=0 if sbjnum==57776667
replace m2q21_a_3=1 if sbjnum==57776667
replace m2q21_a_4=100000 if sbjnum==57776667

replace m3q1_a=-1 if sbjnum==58304993
replace m3q1_c=3 if sbjnum==58304993
replace m3q2_a=-1 if sbjnum==58304993
replace m3q2_c=3 if sbjnum==58304993
replace i_1_m3q3_b=-1 if sbjnum==58304993
replace i_1_m3q3_d=3 if sbjnum==58304993
replace i_2_m3q3_b=-1 if sbjnum==58304993
replace i_2_m3q3_d=3 if sbjnum==58304993
replace m5q6=3 if sbjnum==58304993

replace m2q11_c=120 if sbjnum==58304993

replace m2q48=-1 if sbjnum==58304993

replace m3q1_a=-1 if sbjnum==58412154
replace m3q1_c=3 if sbjnum==58412154
replace m3q2_a=-1 if sbjnum==58412154
replace m3q2_c=3 if sbjnum==58412154
replace i_1_m3q3_b=-1 if sbjnum==58412154
replace i_1_m3q3_d=3 if sbjnum==58412154
replace i_2_m3q3_b=-1 if sbjnum==58412154
replace i_2_m3q3_d=3 if sbjnum==58412154
replace i_3_m3q3_b=-1 if sbjnum==58412154
replace i_3_m3q3_d=3 if sbjnum==58412154
replace i_4_m3q3_b=-1 if sbjnum==58412154
replace i_4_m3q3_d=3 if sbjnum==58412154

replace m3q1_a=-1 if sbjnum==59022719
replace m3q1_c=3 if sbjnum==59022719
replace m3q2_a=-1 if sbjnum==59022719
replace m3q2_c=3 if sbjnum==59022719
replace i_1_m3q3_b=-1 if sbjnum==59022719
replace i_1_m3q3_d=3 if sbjnum==59022719
replace i_2_m3q3_b=-1 if sbjnum==59022719
replace i_2_m3q3_d=3 if sbjnum==59022719
replace i_3_m3q3_b=-1 if sbjnum==59022719
replace i_3_m3q3_d=3 if sbjnum==59022719
replace i_4_m3q3_b=-1 if sbjnum==59022719
replace i_4_m3q3_d=3 if sbjnum==59022719
replace m3q3_f=2 if sbjnum==59022719
replace m3q3_f_other=1 if sbjnum==59022719

replace d1q1="20137" if sbjnum==58681747
replace respondent_id="20137" if sbjnum==58681747

replace duration="00:01:06:53" if sbjnum==58730076

replace m3q3_f=1 if sbjnum==58964038
replace m3q3_f_other=. if sbjnum==58964038
replace i_2_m3q3_c="" if sbjnum==58964038
replace i_4_m3q3_c="" if sbjnum==58964038

replace i_1_m3q3_c="48.750" if sbjnum==59582531

replace m2q21_a_2_best=50000 if sbjnum==59511351
replace m2q23_b_best=0 if sbjnum==59511351
replace m2q21_c_2_best=50000 if sbjnum==59511351
replace m2q19_a_best=-1 if sbjnum==59511351

replace m3q1_a=-1 if sbjnum==59933525
replace m3q1_c=3 if sbjnum==59933525
replace m3q2_a=-1 if sbjnum==59933525
replace m3q2_c=3 if sbjnum==59933525
replace i_1_m3q3_b=-1 if sbjnum==59933525
replace i_1_m3q3_d=3 if sbjnum==59933525
replace i_2_m3q3_b=-1 if sbjnum==59933525
replace i_2_m3q3_d=3 if sbjnum==59933525
replace i_3_m3q3_b=-1 if sbjnum==59933525
replace i_3_m3q3_d=3 if sbjnum==59933525
replace i_4_m3q3_b=-1 if sbjnum==59933525
replace i_4_m3q3_d=3 if sbjnum==59933525

replace m3q1_a=-1 if sbjnum==59838102
replace m3q1_c=3 if sbjnum==59838102
replace m3q2_a=-1 if sbjnum==59838102
replace m3q2_c=3 if sbjnum==59838102
replace i_1_m3q3_b=-1 if sbjnum==59838102
replace i_1_m3q3_d=3 if sbjnum==59838102
replace i_2_m3q3_b=-1 if sbjnum==59838102
replace i_2_m3q3_d=3 if sbjnum==59838102
replace i_3_m3q3_b=-1 if sbjnum==59838102
replace i_3_m3q3_d=3 if sbjnum==59838102
replace i_4_m3q3_b=-1 if sbjnum==59838102
replace i_4_m3q3_d=3 if sbjnum==59838102
replace m5q_answer=-1 if sbjnum==59838102

replace m2q21_c_5=12 if sbjnum==59845601
replace m2q21_c_5=12 if sbjnum==58717531
replace m2q21_c_5=12 if sbjnum==58406326
replace m2q21_c_5=12 if sbjnum==58717528
assert m2q21_c_5==12 | m2q21_c_5==. if sbjnum==59958317
replace m2q21_c_5=12 if sbjnum==59958317

replace m2q21_c_1=3 if sbjnum==58446239
replace m2q21_c_2_best=0 if sbjnum==58446239

replace i_1_m3q3_e=1 if sbjnum==57764401

replace m2q7_a=94 if sbjnum==57764401

replace m2q35_other=500 if sbjnum==58014818

replace m2q9=7.5 if sbjnum==58439739

replace m2q21_c_5=3 if sbjnum==58585413

replace m7q2_a=99 if sbjnum==58717529

replace m2q21_c_1=1 if sbjnum==59831529
replace m2q21_c_2_best=3500 if sbjnum==59831529

replace m2q21_c_1=3 if sbjnum==59924893
replace m2q21_c_2_best=. if sbjnum==59924893

replace m2q11_c=120 if sbjnum==60482599

replace m2q21_a_1=3 if sbjnum==60217458
replace m2q21_a_2_best=. if sbjnum==60217458
replace m2q21_b_1=3 if sbjnum==60217458
replace m2q21_b_2_best=. if sbjnum==60217458
replace m2q21_c_1=3 if sbjnum==60217458
replace m2q21_c_2_best=. if sbjnum==60217458

replace m2q11_c=120 if sbjnum==60767575

replace m5q_answer=-1 if sbjnum==60483400
replace m5q6=3 if sbjnum==60483400

replace m4q4_6=0 if sbjnum==60112995

replace m2q21_c_4=60000 if sbjnum==60484727
replace m2q21_c_5=2 if sbjnum==60484727

replace m3q3_f_other=5 if sbjnum==61023199

replace d1q1="20338" if sbjnum==61040993
replace respondent_id="20338" if sbjnum==61040993

replace m2q13_a=0 if sbjnum==58450255
replace m2q13_b=1 if sbjnum==58450255

replace m2q13_a=0 if sbjnum==60926566
replace m2q13_b=1 if sbjnum==60926566

replace m2q43=1200000 if sbjnum==58404010
replace m2q46_1=1200000 if sbjnum==58404010

replace m2q17_1=. if sbjnum==58543321
replace m2q43=. if sbjnum==58543321

replace m3q1_a=-1 if sbjnum==61753891
replace m3q1_c=3 if sbjnum==61753891
replace m3q2_a=-1 if sbjnum==61753891
replace m3q2_c=3 if sbjnum==61753891
replace i_1_m3q3_b=-1 if sbjnum==61753891
replace i_1_m3q3_d=3 if sbjnum==61753891
replace i_2_m3q3_b=-1 if sbjnum==61753891
replace i_2_m3q3_d=3 if sbjnum==61753891
replace i_3_m3q3_b=-1 if sbjnum==61753891
replace i_3_m3q3_d=3 if sbjnum==61753891
replace i_4_m3q3_b=-1 if sbjnum==61753891
replace i_4_m3q3_d=3 if sbjnum==61753891
replace m5q_answer=-1 if sbjnum==61753891

replace m3q3_f_other=4 if sbjnum==61766199

replace m2q13_a=0 if sbjnum==58429651
replace m2q13_b=1 if sbjnum==58429651

recode m2q17_2-m2q17_13 (0 = -1) if sbjnum==58106303

replace m2q46_3=1300000 if sbjnum==60114774

replace m3q3_f=2 if sbjnum==60433594
replace m3q3_f_other=1 if sbjnum==60433594

replace m3q3_f=2 if sbjnum==61085206
replace m3q3_f_other=1 if sbjnum==61085206
replace m5q6=3 if sbjnum==61085206

replace m2q17_6=3000 if sbjnum==61085206

replace m2q21_a_1=2 if sbjnum==61302606

replace m5q_answer=-1 if sbjnum==61766199

replace m5q6=2 if sbjnum==60793742

replace m5q_answer=8 if sbjnum==61011984

replace m5q_answer=9 if sbjnum==60166918

replace m5q6=3 if sbjnum==60692441

replace m2q21_b_1=1 if sbjnum==61045960

replace m5q4=120.05 if sbjnum==61023195
replace m5q4=120.05 if sbjnum==60797098

replace m2q21_c_1=1 if sbjnum==60482599
replace m2q21_c_2_best=-1 if sbjnum==60482599

replace m2q37_other=3 if sbjnum==61013091

replace m2q13_a=1 if sbjnum==61414299

replace m3q1_a=-1 if sbjnum==63853056
replace m3q1_c=3 if sbjnum==63853056
replace m3q2_a=-1 if sbjnum==63853056
replace m3q2_c=3 if sbjnum==63853056
replace i_1_m3q3_b=-1 if sbjnum==63853056
replace i_1_m3q3_d=3 if sbjnum==63853056
replace i_2_m3q3_b=-1 if sbjnum==63853056
replace i_2_m3q3_d=3 if sbjnum==63853056
replace i_3_m3q3_b=-1 if sbjnum==63853056
replace i_3_m3q3_d=3 if sbjnum==63853056
replace i_4_m3q3_b=-1 if sbjnum==63853056
replace i_4_m3q3_d=3 if sbjnum==63853056

replace m3q1_a=-1 if sbjnum==63741344
replace m3q1_c=3 if sbjnum==63741344
replace m3q2_a=-1 if sbjnum==63741344
replace m3q2_c=3 if sbjnum==63741344
replace i_1_m3q3_b=-1 if sbjnum==63741344
replace i_1_m3q3_d=3 if sbjnum==63741344
replace i_2_m3q3_b=-1 if sbjnum==63741344
replace i_2_m3q3_d=3 if sbjnum==63741344
replace i_3_m3q3_b=-1 if sbjnum==63741344
replace i_3_m3q3_d=3 if sbjnum==63741344
replace i_4_m3q3_b=-1 if sbjnum==63741344
replace i_4_m3q3_d=3 if sbjnum==63741344
replace m3q3_f_other=1 if sbjnum==63741344

replace m5q4=120.05 if sbjnum==63449694

replace m2q14_b=0 if sbjnum==63570929

replace m2q14_a=1 if sbjnum==65121556

replace m2q33_other=500 if sbjnum==65146631

replace m2q6=1 if sbjnum==65558731

replace m2q17_5=88000 if sbjnum==65581827

replace m4q4_4=m4q4_4+24000 if sbjnum==65581827

replace m2q10_a=1 if sbjnum==66119008
replace m2q10_b=2 if sbjnum==66119008

replace m2q48=12500000 if sbjnum==63187087

replace m2q48=-1 if sbjnum==61305623

replace m2q48=1200000 if sbjnum==58547215

replace m2q21_b_1=2 if sbjnum==59450181

replace m2q17_1=450000 if sbjnum==58023929
replace m2q17_1=1399504 if sbjnum==62591787
replace m2q17_2=1000000 if sbjnum==62591787
replace m2q17_1=275000 if sbjnum==61336807
replace m2q17_1=1000 if sbjnum==62413734


*** Correct systematic mistakes ***

* Change m2q21_*_1 to "Break even" if m2q21_*_2 is 0
foreach time in a b c {
	gen error_`time'=(m2q21_`time'_1!=3 & m2q21_`time'_2_best==0)
	replace m2q21_`time'_1=3 if error_`time'==1
	replace m2q21_`time'_2_best=. if error_`time'==1
	drop error_`time'
}

* Change .1 to -1 for "Don't know" (sometimes interviewers entered a dot . instead of a dash -)
foreach myvar of varlist m2q4_b* m2q19* m2q17* m2q21_?_2_* {
	replace `myvar'=-1 if `myvar'==.1
}

* Change variable names to match what is in the paper questionnaire for Game 2 (programmers stored all answers in m5q_answer)
gen m5q2=m5q_answer if m5q1_b==1
gen m5q3=m5q_answer if m5q1_b==2
lab var m5q2 "You have 120 seconds from now on to draw every triangle you see in this figure."
lab var m5q3 "Alright, let me assist you: In this figure, there are 10 triangles. Here you have 10 pieces of paper to use. You have 120 seconds from now to draw every triangle you see in this figure."
order m5q2, after(m5q1_b)
order m5q3, after(m5q2)


*** Save dataset ***

* Destring variables
destring respondent_id, replace
destring m3q1_b m3q2_b i_?_m3q3_c, replace
lab var respondent_id "Respondent ID"

* Drop unnecessary variables
drop sbjnum filter sbjnam usrunq subjdata rvwtime complete stopq test parentid utcdiff qascore frscname exrenum d1q1 i_?_m3q3

* Drop variables that are all missing
drop m1q9_other m2q42_o5 m2q42_o6 m2q42_o7 i_?_m6q4 i_5_m6q3 i_5_m6q3_other

* Save
compress
save "$data_int/fu2_data_cleaned", replace


